package com.zhkj.shixi.tvfilemanager;

import android.content.Context;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;

import java.util.List;

/**
 * Created by linjing on 19-8-9.
 */

public class USBAdapter extends ArrayAdapter<String> {
    private int resourceId;

    public USBAdapter(Context context, int testViewResourceId, List<String> list){
        super(context, testViewResourceId ,list);
        resourceId = testViewResourceId;
    }
    @NonNull
    @Override
    public View getView(int position, @Nullable View convertView, @NonNull ViewGroup parent) {
        String str = getItem(position);
        View view = LayoutInflater.from(getContext()).inflate(resourceId, parent, false);
        TextView textView = (TextView) view.findViewById(R.id.usbName);
        textView.setText(str);
        return view;
    }
}
